#include<bits/stdc++.h>
using namespace std;
#define int long long

struct node {
	int x, idx;
} a[10000];

signed main() {
//	freopen("D:\\desktop\\P1223_3.in", "r", stdin);
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a[i].x;
		a[i].idx = i;
	}
	sort(a + 1, a + n + 1, [](node x, node y) {
		return x.x < y.x;
	});
	int ans = 0, t = 0;
	cout << a[1].idx << " ";
	for (int i = 1; i < n; i++) {
		cout << a[i + 1].idx << " ";
		t += a[i].x;
		ans += t;
	}
	cout << endl << fixed << setprecision(2) << 1.0 * ans / n;
	return 0;
}
